package bingfa;

import java.util.concurrent.LinkedBlockingQueue;

public class SaveProcessor extends Thread implements RequestProcessor{

    private LinkedBlockingQueue<Request> linkedBlockingQueue=new LinkedBlockingQueue();

    public void process(Request request) {
        linkedBlockingQueue.add(request);
    }

    @Override
    public void run() {
        while (true) {
            try {
                Request request=linkedBlockingQueue.take();
                System.out.println("save processor:"+request);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

        }
    }
}
